export default {
    namespaced: true,
    state: {
        // 搜索的类型，显示在导航栏
        searchType: null,

        // 搜索 后 显示的照片
        photo: null,

        // 搜索的结果
        searchResult: {
            name: null,
            content: {}
        },

        // 是否正在加载，用于进入页面的加载效果
        isLoading: true,

        // 是否允许访问结果页
        allowRouter: false
    },
    getters: {},
    mutations: {
        changePageInfo(state, data) {
            state.photo = data.photo || require("@/assets/images/searchView/defult.gif")
            state.searchType = data.searchType
            state.searchResult = data.searchResult
        },

        changeAllowRouter(state, allowRouter) {
            state.allowRouter = allowRouter
        },

        changePhoto(state, photo) {
            state.photo = photo
        },

        changeIsLoading(state, isLoading) {
            state.isLoading = isLoading
        },

        init(state) {
            state.searchType = "识别中..."
            state.photo = require("@/assets/images/searchView/defult.gif")
            state.searchResult = {
                name: "识别中...",
                content: {}
            }
            state.isLoading = true
        }
    },
    actions: {},
    modules: {}
}
